<?php
include_once('config.php');

include_once( CORE_PATH . "/WXJSSDK.php" );
$Auth = new WXJSSDK();


/*$headimgurl = 'http://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epKgrcbDrMyBDZTxCpNApia5kH2yiaQvpZP6RcFnSy5jD4EbJQJJaZOwmauGEQjJ9xOAibSFOMv6Zoeg/0';

$str = file_get_contents($headimgurl);
$str = base64_encode($str);

dump($str);*/

//dump($_SESSION);
/*
 * --------------------------------------------------------------------
 * 载入 页面 ,子控制器 和 方法
 * --------------------------------------------------------------------
 *
 */
$page = (empty($_REQUEST['p']) && empty($_REQUEST['c']))? "index" : strtolower($_REQUEST['p']);
$class = !empty($_REQUEST['c'])? strtolower($_REQUEST['c']) : '';
$method = !empty($_REQUEST['m'])? strtolower($_REQUEST['m']) : '';

//$tb_uid = $_REQUEST['tb_uid'];


if($page == 'index'){
    include_once('front/views/index.html');
}

if (file_exists(CTRLS_PATH.'/'.$class.'.php')) {

    include_once(CTRLS_PATH.'/'.$class.'.php');

    unset($TATA);
    $TATA = new $class();

    //执行方法
    if (method_exists($TATA, $method)) {
        $TATA->$method();
    } else {
        $TATA->index();
    }
}
